/*
 * Created by SharpDevelop.
 * User: Taylor
 * Date: 28/08/2009
 * Time: 22:03
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Drawing;
using System.Windows.Forms;

namespace Backuperer
{
	/// <summary>
	/// Description of addFolder.
	/// </summary>
	public partial class addFolder : Form
	{
		public addFolder()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
		}
		public string folderLocation;
		public string transferLocation;
		public string folderName;
		
		//Shows an addfolder dialouge when you click the addfolder button
		void AddFolderBtnClick(object sender, EventArgs e)
		{
			if(addFolderDlg.ShowDialog() == DialogResult.OK)
			{
				folderLocation = addFolderDlg.SelectedPath;
				folderLoc.Text = folderLocation;
				folderName = folderDesc.Text;
			}
			else
			{
				MessageBox.Show("Please Select A Folder");
			}
		}
		
		//Closes form
		void finishedBtnClick(object sender, EventArgs e)
		{
			this.Close();
		}
		
		//Brings up a folder dialouge for the transfer location
		void TransferLocBtnClick(object sender, EventArgs e)
		{
			if(addTransferFolderDlg.ShowDialog() == DialogResult.OK)
			{
				transferLocation = addTransferFolderDlg.SelectedPath;
				transferLoc.Text = transferLocation;
			}
			else
			{
				MessageBox.Show("Please Select A Folder");
			}
		}
		
		//Runs every time the folderLocation textboxs text is changed
		void FolderLocTextChanged(object sender, EventArgs e)
		{
			folderLocation = folderLoc.Text;
		}
		
		//Runs every time the transferLocation textboxs text is changed
		void TransferLocTextChanged(object sender, EventArgs e)
		{
			transferLocation = transferLoc.Text;
		}
		
		void AddFolderLoad(object sender, EventArgs e)
		{
			folderLoc.Text = MainForm.editFolderLoc;
			transferLoc.Text = MainForm.editTransferLoc;
			folderDesc.Text = MainForm.editName;
			transferLocation = transferLoc.Text;
			folderLocation = folderLoc.Text;
			folderName = folderDesc.Text;
		}
		
		void FolderDescTextChanged(object sender, EventArgs e)
		{
			folderName = folderDesc.Text;
		}
	}
}
